import service from '@/utils/request'

// 患者管理删除
export const deletePatient = (data: any) => {
	return service({
		url: '/empi/masterindex/delete',
		method: 'post',
		data
	})
}

// 患者管理es删除
export const deletePatientEs = (data: any) => {
	return service({
		url: '/empi/masterindex/deleteEs',
		method: 'post',
		data
	})
}

// 患者管理详情
export const getPatientDetail = (data: any) => {
	return service({
		url: '/empi/masterindex/view/' + data,
		method: 'get'
	})
}

// 患者管理保存
export const savePatient = (data: any) => {
	return service({
		url: '/empi/masterindex/save',
		method: 'post',
		data
	})
}

// 身份证是否存在
export const isExistIdCard = (data: any) => {
    return service({
        url: '/empi/masterindex/queryByIdCrd',
        method: 'get',
        params: data,
    })
}

// 患者管理更新
export const updatePatient = (data: any) => {
	return service({
		url: '/empi/masterindex/save',
		method: 'post',
		data
	})
}

// 患者管理 地址信息 列表
export const getPatientAddress = (data: any) => {
	return service({
		url: '/empi/masterindexaddr/getList',
		method: 'get',
		params: data
	})
}
// 患者管理 地址信息 保存
export const savePatientAddress = (data: any) => {
	return service({
		url: '/empi/masterindexaddr/save',
		method: 'post',
		data
	})
}
// 患者信息 地址信息 删除
export const deletePatientAddress = (data: any) => {
	return service({
		url: '/empi/masterindexaddr/delete',
		method: 'get',
		params: data
	})
}

// 患者管理-联系人列表
export const getPatientPerson = (data: any) => {
	return service({
		url: '/empi/masterindexctctrlt/getList',
		method: 'get',
		params: data
	})
}

// 患者管理-联系人信息保存
export const savePatientPerson = (data: any) => {
	return service({
		url: '/empi/masterindexctctrlt/save',
		method: 'post',
		data
	})
}

// 患者管理-联系人信息删除
export const deletePatientPerson = (data: any) => {
	return service({
		url: '/empi/masterindexctctrlt/delete',
		method: 'get',
		params: data
	})
}

// 卡信息 列表
export const getCardList = (data: any) => {
	return service({
		url: '/empi/masterindexcrd/getList',
		method: 'get',
		params: data
	})
}

// 卡信息 保存
export const saveCard = (data: any) => {
	return service({
		url: '/empi/masterindexcrd/save',
		method: 'post',
		data
	})
}

// 卡信息 删除
export const deleteCard = (data: any) => {
	return service({
		url: '/empi/masterindexcrd/delete',
		method: 'get',
		params: data
	})
}

// 证件信息 列表
export const getCertList = (data: any) => {
	return service({
		url: '/empi/masterindexidcrd/getList',
		method: 'get',
		params: data
	})
}

// 证件信息 保存
export const saveCert = (data: any) => {
	return service({
		url: '/empi/masterindexidcrd/save',
		method: 'post',
		data
	})
}

// 证件信息 删除
export const deleteCert = (data: any) => {
	return service({
		url: '/empi/masterindexidcrd/delete',
		method: 'get',
		params: data
	})
}

// 建档信息 列表
export const getFileList = (data: any) => {
	return service({
		url: '/empi/masterindexcrtrcd/getList',
		method: 'get',
		params: data
	})
}

// 建档信息 保存
export const saveFile = (data: any) => {
	return service({
		url: '/empi/masterindexcrtrcd/save',
		method: 'post',
		data: data
	})
}

// 建档信息 删除
export const deleteFile = (data: any) => {
	return service({
		url: '/empi/masterindexcrtrcd/delete',
		method: 'get',
		params: data
	})
}

// 签约信息 列表
export const getSignList = (data: any) => {
	return service({
		url: '/empi/masterindexsgnctrct/getList',
		method: 'get',
		params: data
	})
}

// 签约信息 保存
export const saveSign = (data: any) => {
	return service({
		url: '/empi/masterindexsgnctrct/save',
		method: 'post',
		data
	})
}

// 签约信息 删除
export const deleteSign = (data: any) => {
	return service({
		url: '/empi/masterindexsgnctrct/delete',
		method: 'get',
		params: data
	})
}

// 合并信息
export const getMergeList = (data: any) => {
	return service({
		url: '/empi/masterindex/getList',
		method: 'get',
		params: data
	})
}


// 机构列表
export const useOrgListApi = () => {
	return service({
		url: '/empi/masterindexcrtrcd/getAllOrg',
	})
}